/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entidades;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Damian
 */
@Entity
@Table(name = "offer_hourly")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "OfferHourly.findAll", query = "SELECT o FROM OfferHourly o"),
    @NamedQuery(name = "OfferHourly.findByIdOfferHourly", query = "SELECT o FROM OfferHourly o WHERE o.idOfferHourly = :idOfferHourly")})
public class OfferHourly implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_OFFER_HOURLY")
    private Integer idOfferHourly;
    @JoinColumn(name = "ID_HOURLY", referencedColumnName = "ID_HOURLY_OFFER")
    @ManyToOne(optional = false)
    private HourlyOffer idHourly;
    @JoinColumn(name = "ID_OFFER", referencedColumnName = "ID_OFFER")
    @ManyToOne(optional = false)
    private Offer idOffer;

    public OfferHourly() {
    }

    public OfferHourly(Integer idOfferHourly) {
        this.idOfferHourly = idOfferHourly;
    }

    public Integer getIdOfferHourly() {
        return idOfferHourly;
    }

    public void setIdOfferHourly(Integer idOfferHourly) {
        this.idOfferHourly = idOfferHourly;
    }

    public HourlyOffer getIdHourly() {
        return idHourly;
    }

    public void setIdHourly(HourlyOffer idHourly) {
        this.idHourly = idHourly;
    }

    public Offer getIdOffer() {
        return idOffer;
    }

    public void setIdOffer(Offer idOffer) {
        this.idOffer = idOffer;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idOfferHourly != null ? idOfferHourly.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof OfferHourly)) {
            return false;
        }
        OfferHourly other = (OfferHourly) object;
        if ((this.idOfferHourly == null && other.idOfferHourly != null) || (this.idOfferHourly != null && !this.idOfferHourly.equals(other.idOfferHourly))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidades.OfferHourly[ idOfferHourly=" + idOfferHourly + " ]";
    }
    
}
